<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
	<%@include file="/views/common/include/taglib.jsp"%>
	<%@include file="/views/common/include/head.jsp"%>
	<title>D 生活</title>
	<link rel="stylesheet" href="${ctx}/css/page/header2.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/reset.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/shangpind.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/shangchennav.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/hot-shop.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/footer.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/page.css" type="text/css">
</head>
<style>

	/* .footer_ul{
	color:#959191;
	}
	.footer_ul li{
	float:left;
	text-align: center;
	border: 1px solid #9A9A9A;
	}
	.footer_ul .active {
    background-color: #28c7c9;
    color:#fff;
    }
	.footer_ul li:HOVER{
    background-color: #28c7c9;
	} */
	div .shop-wrap:hover{
    box-shadow: 2px 4px 6px #A29E9E;
	}
	.shop-nav li a:hover{
	color:red;
	}
	.selected{
	color:red;
	}
	 .padd-1 img:hover{
	cursor:pointer;
	-webkit-transform:scale(1.1);
} 
</style>	
	<script type="text/javascript">
    var ctx = '${ctx}';

	function gotoPage(page){
 		var pages = $("#pages").val();
		var shopCategoryId = $("#shopCategoryId").val();
    	if(page == null || page == 'undefined'){
    		page = this.page;
    	}
    	if(page < 1 ){
    		layer.msg("已到达第一页!", {
				time : 2000
			// 2秒关闭（如果不配置，默认是3秒）
			});
    	} else if(page > pages){
    		layer.msg("已到达最后一页!", {
				time : 1000
			// 2秒关闭（如果不配置，默认是3秒）
			});
    	} else {
    		window.location.href= ctx + "/hotShopList?pNo=" + page + "&shopCategoryId=" + shopCategoryId; 
    	}
	}
	
	$(document).ready(function(){
		$(".padd img").hover(function(){$(this).addClass("hover")},
			function(){$(this).removeClass("hover")}
		)	
	})
	
	function searchGoodsOrShops(){
		var selectType = $("#selectType").val();
		var name = $("#name").val();
		window.location.href = ctx +"/searchGoodsOrShops?pNo=1" + "&selectType=" +selectType +"&name=" + name;
	}
</script>
<body>
    <jsp:include page="/views/common/head_main.jsp" />

	<div class="bg">
	<input type="hidden" id="item" value="${sessionScope.item_mall}"/>
		<div class="contentbox1 contentbox">
			<div class="nav">
				 <ul>
                    <li><a href="${ctx}/main?item=4">商城首页</a></li><span>|</span>
                    <li><a href="${ctx}/mallSeckill">秒杀专区</a></li><span>|</span>
                    <li><a href="${ctx}/main?item=4#article">精品推荐</a></li><span>|</span>
                    <li><a href="${ctx}/main?item=4#hotshop">热门商铺</a></li><span>|</span>
                    <li><a href="${ctx}/mallIntegral">积分专区</a></li>
                </ul>
				<div class="seabox">
					<select class="searchhh" id="selectType">
					<option value="1">商品</option>
					<option value="2">店铺</option>
					</select>
					<input class="search" type="text" id="name"></input>
					<button class="searchbtn" onclick="searchGoodsOrShops()">搜索</button>
				</div>
				 <div class="cartbox">
                	 <img src="${ctx}/images/mall/cart.png">&nbsp;&nbsp;&nbsp;<a href="${ctx}/shopcart/shopcartList" target="_blank">我的购物车</a>
                </div>
			</div>
		</div>
		<div class="contentbox3 contentbox">
			<div class="re-item-l">
				<div class="re-title">热门店铺</div>
				<div class="padd-1">
					<ul>
						<c:if test="${fn:length(adHotShopInfos)  > 6}">
							<c:forEach items="${adHotShopInfos}" var="item" begin="0" end="5" varStatus="status">
								<li>
									<div style="padding-left: 14px;<c:if test='${status.index == 0}'>padding-top: 20px;</c:if>" >
										<a <c:if test="${item.objType ==2}"> href="${ctx}/GoodsDetail?id=${item.objId}"</c:if> 
								        <c:if test="${item.objType == 1}"> href="${ctx}/shopIndex?pNo=1&shopId=${item.objId}"</c:if>
								        <c:if test="${item.objType == 3}"> href="${item.url}"</c:if> >
											
											<img style="border: 1px solid #ccc;" width="155" height="110" src="${sessionScope.image_logo}${item.img}"/>
										</a>
									</div>
								</li>
	               		 	</c:forEach>
						</c:if>
						<c:if test="${fn:length(adHotShopInfos)  <= 6}">
							<c:forEach items="${adHotShopInfos}" var="item" varStatus="status">
								<li>
									<div style="padding-left: 14px;<c:if test='${status.index == 0}'>padding-top: 20px;</c:if>">
										<a <c:if test="${item.objType ==2}"> href="${ctx}/GoodsDetail?id=${item.objId}"</c:if> 
								        <c:if test="${item.objType == 1}"> href="${ctx}/shopIndex?pNo=1&shopId=${item.objId}"</c:if>
								        <c:if test="${item.objType == 3}"> href="${item.url}"</c:if> >
											<img   style="border: 1px solid #ccc;" width="155" height="110" src="${sessionScope.image_logo}${item.img}"/>
										</a>
									</div>
								</li>
	               		 	</c:forEach>
						</c:if>
					</ul>
				</div>
			</div>
			
			<div class="shop-list">
				<div class="padd1">
					<div class="shop-nav" style="width:100%;height:30px;line-height: 30px;">
						<input id="shopCategoryId" type="hidden" value="${shopCategoryId}"/>
						<ul>
							<li class="shop-type"><a href="">店铺分类：</a></li>
								<li><a href="${ctx}/hotShopList?pNo=1" <c:if test="${shopCategoryId == null}">class="selected"</c:if>>不限</a></li>
							<c:forEach items="${shopCategoryList}" var="item" varStatus="status">
								<li>
									<a href="${ctx}/hotShopList?pNo=1&shopCategoryId=${item.id}" <c:if test="${shopCategoryId == item.id}">class="selected"</c:if>>${item.name}</a>
								</li>
							</c:forEach>
						</ul>
						<!-- <span class="own-shop"><input class="checkbox" type="checkbox"/>自营店</span> -->
					</div>
					<div class="shop-box">
						<c:forEach items="${shopInfoList.list}" var="item" varStatus="status">
							<div class="shop-wrap shop-left">
								<a href="${ctx}/shopIndex?pNo=1&shopId=${item.id}&shopName=${name}">
									<div class="padd3">
										<img class="icon1" width="140" height="140" src="${sessionScope.image_logo}${item.logo}">
										<p class="title"><img class="icon2" src="${ctx}/images/mall/shop/rm2.png"><span  class="num-color">${item.name}</span></p>
										<p>共有<span class="num-color">${item.goodsCount}</span>件商品</p>
										<p>主营：<span class="num-color" style="text-decoration :underline; ">${item.businessRange}</span></p>
										<p>营业时间：${item.beginTime }-${item.endTime }</p>
									</div>
								 </a>
							</div>
						</c:forEach>
							
							
					</div>
					<div style="background-color: #fff;height: 80px;">
						<table width="100%">
						<tfoot>
		            	<tr>
			               <td colspan="7">
			               		<div class="page">
											<input id="pages" type="hidden" value="${shopInfoList.pages}">
											<ul>
												<li><a class="last-page page-change " onclick="gotoPage(${currentPage-1 });">&lt;上一页</a></li>
												<c:if test="${shopInfoList.firstPage > 1}">
													<li onclick="gotoPage(1);"
														class="page-num"><a>1</a></li>
													<c:if test="${shopInfoList.firstPage > 2}">
						                       		...
						                       		</c:if>
												</c:if>
												<c:forEach items="${shopInfoList.navigatepageNums }" var="page">
													<li onclick="gotoPage(${page });"
														class="<c:if test="${currentPage == page }">current</c:if>"
														class="page-num"><a>${page}</a></li>
												</c:forEach>
												<c:if test="${shopInfoList.lastPage < shopInfoList.pages}">
													<c:if test="${shopInfoList.firstPage < shopInfoList.pages - 1}">
						                       		...
						                       		</c:if>
													<li onclick="gotoPage(${shopInfoList.pages});"
														class="page-num"><a>${shopInfoList.pages}</a>
													</li>
												</c:if>
												<li><a class="next-page page-change" onclick="gotoPage(${currentPage+1 });">下一页&gt;</a></li>
											</ul>
										</div>
			               
			                <%--   <div>
			                    <div style="float:left;padding-left:30px;color:#959191;">
			                      <span class="total">合计 ${shopInfoList.total} 条数据</span>               
			                    </div>
			                    <div style="float:right;width:20%;"> 
				                  <div style="float:left;">                 
				                      <ul class="footer_ul">
				                      	<c:if test="${shopInfoList.hasPreviousPage }">
				                        <li onclick="gotoPage(${currentPage-1 });" style="width:55px;cursor: pointer;"><a class="leftRight" >&lt;上一页</a></li>
				                      	</c:if>
				                        <c:if test="${shopInfoList.firstPage > 1}">
				                        	<li onclick="gotoPage(1);" style="width:24px;text-align: center;cursor: pointer;">
				                             	<a>1</a>
				                        	</li>
				                        	<c:if test="${shopInfoList.firstPage > 2}">
				                        		...
				                        	</c:if>
				                      	</c:if>
				                        <c:forEach items="${shopInfoList.navigatepageNums }" var="page">
				                        <li onclick="gotoPage(${page });" class="<c:if test="${currentPage == page }">active</c:if>" style="border: 1px solid #9A9A9A;width:24px;text-align: center;cursor: pointer;">
				                             <a>${page}</a>
				                        </li>
				                        </c:forEach>
				                        <c:if test="${shopInfoList.lastPage < shopInfoList.pages}">
				                        	<c:if test="${shopInfoList.firstPage < shopInfoList.pages - 1}">
				                        		...
				                        	</c:if>
				                        	<li onclick="gotoPage(${shopInfoList.pages});" style="border: 1px solid #9A9A9A;width:24px;text-align: center;cursor: pointer;">
				                             	<a>${shopInfoList.pages}</a>
				                        	</li>
				                      	</c:if>
				                        <c:if test="${shopInfoList.hasNextPage }">
				                        <li style="cursor: pointer;width:55px;"><a onclick="gotoPage(${currentPage+1});" class="leftRight" >下一页&gt;</a></li>
				                      	</c:if>
				                      </ul>
			                     </div>
		                   		<div style="float:left;  height: 30px;">
									<span style="color: #9A9A9A;">跳转到</span> 
									<input class="inputclass" id="pageNo" onkeydown="if(event.keyCode==13){event.keyCode=0;return false;}" type="text" value="${currentPage }" style="width:22px;height:20px;text-align: center;">
									<span style="color: #9A9A9A;">页</span> 
									<span class="buttonclass" id="J_JumpTo" onclick="gotoCellInfoPage(null);"><a>GO</a></span>
								</div>
			                 </div>
			                 </div> --%>
							</td>
						</tr>
					</tfoot>
					</table>
					</div>
					
				</div>
			</div>
		</div>
	</div>
	<jsp:include page="/views/common/footer.jsp" />
	</body>
	</html>